package com.mrjoew.weekend.web;

import com.mrjoew.weekend.services.sys.SysAccountService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Christopher Jones
 * @ClassName UserController
 * @explain
 * @date 2020/6/17 0017 19:32
 */
@Api(tags = "用户")
@RequestMapping(value = "/user")
@RestController
public class UserController {

    private final SysAccountService sysAccountService;

    @Autowired
    public UserController(SysAccountService sysAccountService) {
        this.sysAccountService = sysAccountService;
    }

    @GetMapping(value = "/list")
    public Map<String, Object> list() {
        Map<String, Object> result = new HashMap<>();
        result.put("list", sysAccountService.list(null));
        return result;
    }
}
